﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.Domain
{
    /// <summary>
    /// 已发货订单主表
    /// </summary>
    public class ShippedOrder
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string OrderNumber { get; set; }

        /// <summary>
        /// 团队
        /// </summary>
        [MaxLength(100)]
        public string Team { get; set; }

        /// <summary>
        /// 仓库名称
        /// </summary>
        [MaxLength(100)]
        public string WarehouseName { get; set; }

        /// <summary>
        /// 总重量(KG)
        /// </summary>
        public decimal TotalWeight { get; set; }

        /// <summary>
        /// 总费用(元)
        /// </summary>
        public decimal TotalFee { get; set; }

        // 收件人信息
        /// <summary>
        /// 收件人姓名
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string RecipientName { get; set; }

        /// <summary>
        /// 收件人手机
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string RecipientPhone { get; set; }

        /// <summary>
        /// 国家
        /// </summary>
        [MaxLength(50)]
        public string Country { get; set; }

        /// <summary>
        /// 省份
        /// </summary>
        [MaxLength(50)]
        public string Province { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        [MaxLength(50)]
        public string City { get; set; }

        /// <summary>
        /// 详细地址
        /// </summary>
        [MaxLength(500)]
        public string Address { get; set; }

        /// <summary>
        /// 邮编
        /// </summary>
        [MaxLength(10)]
        public string PostalCode { get; set; }

        /// <summary>
        /// 发货时间
        /// </summary>
        public DateTime ShippedTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 查看时间
        /// </summary>
        public DateTime? ViewedTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [MaxLength(50)]
        public string CreatedBy { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(1000)]
        public string Remark { get; set; }

        /// <summary>
        /// 跟踪单号
        /// </summary>
        [MaxLength(100)]
        public string TrackingNumber { get; set; }

        /// <summary>
        /// 物流公司
        /// </summary>
        [MaxLength(100)]
        public string LogisticsCompany { get; set; }

        // 导航属性
        /// <summary>
        /// 订单明细列表
        /// </summary>
        public virtual ICollection<ShippedOrderDetail> OrderDetails { get; set; } = new List<ShippedOrderDetail>();

        /// <summary>
        /// 费用明细列表
        /// </summary>
        public virtual ICollection<OrderFee> OrderFees { get; set; } = new List<OrderFee>();

        /// <summary>
        /// 操作记录列表
        /// </summary>
        public virtual ICollection<OrderOperation> OrderOperations { get; set; } = new List<OrderOperation>();

        /// <summary>
        /// 附件列表
        /// </summary>
        public virtual ICollection<OrderAttachment> OrderAttachments { get; set; } = new List<OrderAttachment>();
    }

}
